package cloud.xlh.digital_power_pay.facade.order.impl;


import cloud.xlh.digital_power_pay.client.order.dto.OrderDTO;
import cloud.xlh.digital_power_pay.client.order.service.OrderClientService;
import cloud.xlh.digital_power_pay.domian.order.OrderSaveDomain;
import cloud.xlh.digital_power_pay.intergration.order.adapter.OrderClientAdapter;
import cloud.xlh.digital_power_pay.service.order.service.OrderService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * Created with IntelliJ IDEA.
 *
 * @ project name : xlh_osms
 * @ Author: XuLeHuang
 * @ Date: 2023/8/12 18:08
 * @ Description:
 */
@Service
public class OrderClientServiceImpl implements OrderClientService {
    @Resource
    private OrderClientAdapter orderClientAdapter;
    @Resource
    private OrderService orderService;

    @Override
    public String genOrder(OrderDTO orderDTO) {
        OrderSaveDomain orderSaveDomain = orderClientAdapter.convertOrderSaveDomain(orderDTO);
        return orderService.genOrder(orderSaveDomain);
    }
}
